//
//  SettlementDetailsCell.m
//  ios-supplier
//
//  Created by Benlai on 15/8/30.
//  Copyright (c) 2015年 feynmanyuan. All rights reserved.
//

#import "SettlementDetailsCell.h"

@interface SettlementDetailsCell()
@property (weak, nonatomic) IBOutlet UILabel *lblBalanceID; // 序号
@property (weak, nonatomic) IBOutlet UILabel *lblSoNumber; // 订单编号
@property (weak, nonatomic) IBOutlet UILabel *lblSettlePrice; // 订单结算总金额
@property (weak, nonatomic) IBOutlet UILabel *lblFreight; // 商品结算金额
@property (weak, nonatomic) IBOutlet UILabel *lblInsteadPrice; // 运费
@property (weak, nonatomic) IBOutlet UILabel *lblSoCreateAt; // 代购费
@property (weak, nonatomic) IBOutlet UILabel *lblSoFinishAt; // 补贴
@property (weak, nonatomic) IBOutlet UILabel *lblLongDistribution; // 扣款
@property (weak, nonatomic) IBOutlet UILabel *lblTotalPrice; //调单补贴

@end
@implementation SettlementDetailsCell

- (void)awakeFromNib {

}

-(void)setSettlementDetails:(JFBSettlementDetailsDS *)settlementDetails
{
    self.lblBalanceID.text = [NSString stringWithFormat: @"%ld", settlementDetails.balance_id];//序号
    self.lblSoNumber.text = [NSString stringWithFormat:@"%@",settlementDetails.so_number];//订单编号
    double flout =  [settlementDetails.settle_price doubleValue];
    double flout1 = [settlementDetails.so_bonus doubleValue];
    double flout2 = [settlementDetails.so_fine doubleValue];
    double flout3 = [settlementDetails.transfer_bonus doubleValue];
    double flout4 = flout + flout1 - flout2 +flout3;
    self.lblSettlePrice.text =[NSMutableString stringWithFormat:@"￥%.1f",flout4];//订单结算总金额
    
    self.lblFreight.text = [NSString stringWithFormat:@"￥%@",[NSString decimalToString:settlementDetails.settle_price]];//商品结算金额
    
    self.lblInsteadPrice.text = [NSString stringWithFormat:@"￥%@",[NSString decimalToString:settlementDetails.freight]];//运费

    self.lblSoCreateAt.text = [NSString stringWithFormat:@"￥%@",[NSString decimalToString:settlementDetails.instead_price]];//代购费

    self.lblSoFinishAt.text = [NSMutableString stringWithFormat:@"￥%@",[NSString decimalToString:settlementDetails.so_bonus]];//补贴

    self.lblLongDistribution.text = [NSMutableString stringWithFormat:@"￥%@",[NSString decimalToString:settlementDetails.so_fine]];//扣款
    
    
    self.lblTotalPrice.text = [NSMutableString stringWithFormat:@"%@",[NSString decimalToString:settlementDetails.transfer_bonus]];//调单补贴
    

    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];


}

@end
